package com.sjtucook;

import android.app.Activity;
import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;

public class SearchableActivity extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		// Get the intent, verify the action and get the query
		Intent intent = getIntent();
		if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
			String query = intent.getStringExtra(SearchManager.QUERY);
			Intent resultIntent = new Intent(SearchableActivity.this,DishListActivity.class);
			Bundle bundle = new Bundle();
			bundle.putString(DishListActivity.FLAG, DishListActivity.SEARCH);
			bundle.putString(DishListActivity.QUERY, query);
			resultIntent.putExtras(bundle);
			startActivity(resultIntent);
			finish();
		}

	}

}
